@import "../components/link";
@import "../components/inputs";

@import "./components/feed-item";
@import "./components/profile-preview";
@import "./components/profile-lite";

.window-content.builtin.timeline {
  background: #f3f3f3;
  padding-bottom: 20px;
}

.timeline-wrapper {
  position: relative;

  .loading-container {
    background: #fff;
    width: 100%;
    padding: 15px 0;
  }

  .spinner {
    width: 30px;
    height: 30px;
    margin: auto;
  }

  .new-posts-indicator {
    background: #fafafa;
    cursor: pointer;
    padding: 10px 15px;
    text-align: center;
    color: var(--theme-color);
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;

    &:hover {
      background: #eee;
    }

    &:empty {
      display: none;
    }
  }

  .avatar-container {
    display: inline-block;
  }

  .text,
  .name,
  .bio {
    color: black;
  }

  .url {
    color: var(--theme-color);
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }

  .name {
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }

  .text,
  .bio {
    line-height: 1.425;
    font-size: .8rem;
  }

  a {
    color: var(--theme-color);
    text-decoration: none;
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }

  .builtin-main {
    margin: auto !important;
    max-width: 900px !important;
    padding: 0 20px !important;
  }

  .btn {
    border: 1px solid var(--theme-color);
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 40px !important;
    color: var(--theme-color);

    &:hover {
      background: none;
    }

    &:focus {
      box-shadow: 0 0 0 2px var(--theme-color-box-shadow);
    }

    &.follow-btn {
      background: transparent;
    }

    &.follow-btn.following,
    &.new-reply,
    &.new-post {
      background: var(--theme-color);
      color: #fff;
      -webkit-font-smoothing: antialiased;
      font-weight: 600 !important;

      &:hover {
        // TODO
      }

      &:disabled {
        background: var(--theme-color-box-shadow) !important;
        color: fadeout(#fff, 10%) !important;
        border: none !important;
      }
    }
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    width: 100%;
    height: 45px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 0 1px rgba(0,0,0,.1);

    .container {
      &:extend(.flex);
      align-items: center;
      justify-content: space-between;
      margin: auto;
      padding: 0 20px;
      width: 100%;
      max-width: 900px;

      * {
        display: inline-block;
      }
    }

    .nav-link {
      cursor: pointer;
      padding: 0 10px;
      height: 45px;
      line-height: 45px;
      vertical-align: baseline;
      border-bottom: 3px solid var(--theme-color);
      font-size: .8rem;
      color: @color-text--muted;

      .icon {
        width: 18px;
        height: 18px;
        margin-right: 5px;

        * {
          stroke: @color-text--light;
        }
      }

      &:hover {
        color: var(--theme-color);

        .icon * {
          stroke: var(--theme-color);
        }
      }
    }

    .avatar {
      width: 28px;
      height: 28px;
      line-height: 45px;
      vertical-align: middle;
    }
  }

  .view-header {
    background: #fff;
    height: 50px;
    border-bottom: 1px solid #eee;
    padding: 0 15px;

    .nav-link {
      display: inline-block;
      border-bottom: 2px solid transparent;
      font-weight: 500;
      height: 100%;
      width: 75px;
      padding: 5px 10px;
      text-align: center;
      color: @color-text--muted;
      cursor: pointer;

      * {
        cursor: pointer;
      }

      .label {
        font-size: 11px;
        margin-bottom: 3px;
        display: block;
      }

      .value {
        font-size: 16px;
        margin-top: -4px;
      }

      &:hover,
      &.active {
        color: var(--theme-color);
        border-color: var(--theme-color);
      }
    }
  }

  .view {
    &:extend(.flex);
    flex-wrap: nowrap;
    width: 100%;
    height: 100vh;
    margin-top: 85px !important;

    .sidebar-col {
      flex-basis: 33%;
      margin-right: 15px;
    }

    .main-col {
      flex-basis: 67%;
    }
  }

  .view-content-header {
    &:extend(.flex);
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: 40px;
    font-size: .85rem;
    color: rgba(0,0,0,.5);
    font-weight: 300;

    h2 {
      color: rgba(0,0,0,.5);
      text-transform: none;
      font-size: .75rem;
      font-weight: 400;
      margin: 0;
      letter-spacing: 0;
    }
  }

  // feed view
  .view.feed {

    .reply-form,
    .new-post-form {
      background: var(--theme-color-faded);
      padding: 15px;
    }

    .new-post-form {
      height: 65px;

      &.editing {
        height: 130px;
      }

      .actions {
        text-align: right;
        margin-top: 10px;
        display: none;

        &.editing {
          display: block;
        }
      }

      textarea {
        display: inline-block;
      }

      .avatar-container {
        vertical-align: top;
      }

      .avatar {
        width: 30px;
        height: 30px;
        margin-top: 3px;
        margin-right: 10px;
      }
    }
  }

  .view.friends,
  .view.following {

    .following-list {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-gap: 10px;
      margin-top: 10px;
    }
  }

  .profile-card {
    -webkit-font-smoothing: antialiased;

    .avatar {
      width: 60px;
      height: 60px;
      margin-right: 5px;
    }

    .name {
      vertical-align: top;
    }

    .bio {
      line-height: 1.4;
      font-size: .8rem;
    }
  }

  .friends-list-container {

    .friends-list {
      display: grid;
      grid-gap: 5px;
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
      width: 250px;
      margin-top: 5px;
    }

    .avatar {
      width: 45px;
      height: 45px;
    }
  }

  .who-to-follow-container {
    background: #fff;
    padding: 10px 15px 0 15px;
    margin-top: 20px;

    h2 {
      margin-top: 0;
      text-transform: none;
      color: @color-text;
      font-weight: 500;
      font-size: .95rem;
      letter-spacing: 0;
    }
  }

  .post-actions {

    .action {
      display: inline-block;
      width: 55px;

      &.voted {

        .count {
          color: crimson;
        }
      }
    }

    .count {
      color: @color-text--muted;
      font-size: 11.5px;
      font-weight: 500;
      line-height: 1.3;
      vertical-align: top;
      margin-left: 5px;
    }

    .icon * {
      stroke: #999;
      stroke-width: 8px;
    }

    .icon:hover * {
      stroke: #777;
    }

    .vote-icon {
      &.voted {

        .heart * {
          fill: crimson;
          stroke: crimson;
        }

        &:hover {
          stroke: crimson;
        }
      }
    }

    .icon {
      cursor: pointer;
      width: 14.5px;
      height: 14.5px;
    }
  }

  .timestamp {
    color: rgba(0, 0, 0, .4);

    &:hover {

      .value {
        text-decoration: underline;
      }
    }
  }

  .popup-wrapper {
    background: rgba(0,0,0,.2);
  }

  textarea {
    width: ~"calc(100% - 55px)";
    padding-top: 9px;
    line-height: 1.3;
    resize: none;
    cursor: text;
    transition: height .15s ease;

    &:focus {
      box-shadow: 0 0 0 2px var(--theme-color-box-shadow)
    }
  }
}